import { createRouter,createWebHistory } from 'vue-router'
import LoginVue from "@/view/LoginVue.vue";
import LayoutVue from "@/view/LayoutVue.vue";
import UserMassage from "@/view/article/UserMassage.vue";
import ResourcesVue from "@/view/article/ResourcesVue.vue";
import PublicResourcesVue from "@/view/article/PublicResourcesVue.vue";
import BeAddVue from "@/view/article/BeAddVue.vue";
import AttentionVue from "@/view/article/AttentionVue.vue";
//定义路由关系
const routes=[
    {
        path:'/',component:LoginVue
    },
    {
        path: '/main',component: LayoutVue,
        redirect:'/user',
        children : [
            {path:'/user',component: UserMassage },
            {path:'/resources',component: ResourcesVue},
            {path: '/publicresources',component: PublicResourcesVue},
            {path: '/beadd',component: BeAddVue},
            {path: '/attention',component: AttentionVue}
        ]
    }
]
//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

//导出路由
export default router

